package com.cuitrip.business.login.model;

import com.alibaba.fastjson.JSONObject;

import java.io.Serializable;
import java.util.HashMap;

import cn.sharesdk.framework.Platform;

/**
 * Created by ak on 15/10/30.
 */
public class ThirdAccount implements Serializable{

    public static final int WE_CHAT = 0x01;

    public static final int FACEBOOK = 0x02;

    public static final int GOOGLE = 0x03;

    public static final int WEIBO = 0x04;


    public static final int RESULT_NO_PHONE = 100;
    public static final int RESULT_NO_PASSWORD = 102;

    public int accountType;

    public String avatarPic;

    public String nickName;

    public String email;

    private String thirdObject;

    public String getThirdObject() {
        return thirdObject;
    }

    public void setThirdObject(String thirdObject) {
        this.thirdObject = thirdObject;
    }

    public int getAccountType() {
        return accountType;
    }

    public void setAccountType(int accountType) {
        this.accountType = accountType;
    }

    public String getAvatarPic() {
        return avatarPic;
    }

    public void setAvatarPic(String avatarPic) {
        this.avatarPic = avatarPic;
    }

    public String getNickName() {
        return nickName;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public void setDataParams(HashMap<String,Object> userDataParams){
        if (accountType == WE_CHAT){
            ThirdAccountParser.WECHAT.parseObject(this,userDataParams);
        }else if (accountType == FACEBOOK){
            ThirdAccountParser.FACEBOOK.parseObject(this,userDataParams);
        }else if (accountType == GOOGLE){
            ThirdAccountParser.GOOGLE.parseObject(this, userDataParams);
        }else if (accountType==WEIBO){
            ThirdAccountParser.WEIBO.parseObject(this,userDataParams);
        }
    }



}
